package com.sikaryofficial.backend.controller;

import com.sikaryofficial.backend.domain.dto.req.StoreFollowSaveListReq;
import com.sikaryofficial.backend.manager.StoreFollowManager;
import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.common.core.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : wuweihong
 * @desc : 店铺回访记录
 * @date : 2025-01-03
 */

@RestController
@RequestMapping("/store/followup")
@Api(tags = "店铺回访记录")
@Slf4j
public class StoreFollowController extends BaseController {

	@Autowired
	private StoreFollowManager storeFollowManager;

	@PostMapping("/saveBatch")
	@ApiOperation("批量保存回访记录")
	public R<Void> saveBatch(@Validated @RequestBody StoreFollowSaveListReq saveListReq) {
		storeFollowManager.saveBatch(saveListReq);
		return R.ok();
	}

	@GetMapping("/deleteById/{storeFollowId}")
	@ApiOperation("删除单条回访记录")
	public R<Boolean> deleteById(@PathVariable("storeFollowId") Long storeFollowId) {
		return R.ok(storeFollowManager.deleteByFollowId(storeFollowId));
	}

}
